package com.zxp.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @author: 张新朋
 * @time: 2020/5/1 15:59
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    //@LoadBalanced //实现负载均衡，让消费者随机访问生产者端口
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}